package com.qingcloud.base.api.remote.executor.fallback;

import com.qingcloud.base.api.remote.executor.ExecutorApi;
import com.qingcloud.base.exception.WamingException;
import com.qingcloud.base.exception.WamingExceptionEnum;
import com.qingcloud.base.pojo.ApiResult;
import com.qingcloud.base.remote.executor.ExecutorParam;
import com.qingcloud.base.remote.executor.JobInstanceFileLog;
import com.qingcloud.base.remote.executor.JobRuntimeParam;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
public class ExecutorApiFallback implements ExecutorApi {

    @Setter
    private Throwable cause;

    @Override
    public ApiResult startInstance(ExecutorParam.InstanceParam instanceParam) throws Exception {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult stopInstance(ExecutorParam.InstanceParam instanceParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult destroyInstance(ExecutorParam.InstanceParam instanceParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult saveTask(ExecutorParam.InstanceParam instance) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult deleteTask(ExecutorParam.InstanceParam instance) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult triggerTask(ExecutorParam.InstanceParam instance) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult getCron(ExecutorParam.InstanceParam instance) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult startJob(ExecutorParam.JobParam jobParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult stopJob(ExecutorParam.JobParam jobParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult destroyJob(ExecutorParam.JobParam jobParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult importJob(MultipartFile file) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult baseConfig(ExecutorParam.ComponentConfigParam compParam) throws WamingException {
        return ApiResult.fail(9001);
    }

    @Override
    public ApiResult syncConfig(ExecutorParam.ComponentConfigParam compParam) throws WamingException {
        return ApiResult.fail(9001);
    }
}
